package com.longxiao.vo;


import com.longxiao.validator.anno.ValiCnMobile;
import com.longxiao.validator.anno.ValiNumber;
import com.longxiao.validator.anno.ValiString;

/**
 * Created by houhongwei on 2017/5/12.
 */
public class ValidatorTest {

    @ValiString(minLen = 5, maxLen = 20, err = "用户名长度必须在5-20个字符", required = false)
    String username;

    @ValiNumber(ref = {20, 25}, err = "年龄必须为18-60岁")
    int age;

    @ValiString(regex = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", err = "请输入合法的邮箱")
    String email;

    @ValiCnMobile(err = "请输入正确的手机号码")
    String mobile;

    String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
}
